//
//  MyHeaderView.m
//  LazyCat
//
//  Created by zhanshu on 15/9/7.
//  Copyright (c) 2015年 zhanshu. All rights reserved.
//

#import "MyHeaderView.h"
#import "LoginViewController.h"
#import "Html5ViewController.h"
#import "OrderViewController.h"
#import "ZBarScanVC.h"
#import "ScanPayFirstVC.h"
@implementation MyHeaderView

- (void)awakeFromNib {
    self.backgroundColor = SetColor(255, 255, 255, 1);
    _userName.font = [UIFont boldSystemFontOfSize:18];
    UILabel *label1 = [[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth/3, 170, 0.5, 53)];
    label1.backgroundColor = SetColor(225, 225, 225, 1);
    [self addSubview:label1];
    
    UILabel *label2 = [[UILabel alloc]initWithFrame:CGRectMake(2*ScreenWidth/3, 170, 0.5, 53)];
    label2.backgroundColor = SetColor(225, 225, 225, 1);
    [self addSubview:label2];
    
    UILabel *label3 = [[UILabel alloc]initWithFrame:CGRectMake(0, 222.5, ScreenWidth, 0.5)];
    label3.backgroundColor = SetColor(225, 225, 225, 1);
    [self addSubview:label3];
    
//    UILabel *label4 = [[UILabel alloc]initWithFrame:CGRectMake(0, 237.5, ScreenWidth, 0.5)];
//    label4.backgroundColor = SetColor(225, 225, 225, 1);
//    [self addSubview:label4];
}
- (IBAction)ThreeButtonAction:(UIButton *)sender {
    NSDateFormatter *df = [[NSDateFormatter alloc]init];//格式化
    [df setDateFormat:@"yyyy-MM-dd"];
    NSDate *tdt = [NSDate date];
    NSString *today = [df stringFromDate:tdt];
    NSLog(@"%@",today);
    NSDate *ydt = [[NSDate date] dateByAddingTimeInterval:-24*60*60];
    NSString *yesterday = [df stringFromDate:ydt];
    NSLog(@"%@",yesterday);
    if (sender.tag == 100) { // 今日订单
        OrderViewController *order = [[OrderViewController alloc] init];
        order.todayOrder = 3;
        order.orderDate = today;
        [sender.viewController.navigationController pushViewController:order animated:YES];
    }else if (sender.tag == 200){ // 代发货
        OrderViewController *order = [[OrderViewController alloc] init];
        order.orderDate = @"";
        [sender.viewController.navigationController pushViewController:order animated:YES];
    }else if (sender.tag == 300){ // 昨日订单
        OrderViewController *order = [[OrderViewController alloc] init];
        order.todayOrder = 3;
        order.orderDate = yesterday;
        [sender.viewController.navigationController pushViewController:order animated:YES];
    }
}
- (IBAction)pay:(UIButton *)sender {
    if (sender.tag == 1000) { //扫一扫
        //[[MessShowView share] showWithMess:@"扫一扫"];
        ScanPayFirstVC *scanFirVC = [[ScanPayFirstVC alloc]init];
        [self.viewController.navigationController pushViewController:scanFirVC animated:YES];
    }else if (sender.tag == 2000){ //收款
        [[MessShowView share] showWithMess:@"卡券核销"];
    }else if (sender.tag == 3000){ //核算
        [[MessShowView share] showWithMess:@"会员消费"];
    }
}

@end
